package com.campus.controller.normal;

import com.campus.pojo.vo.CaptchaVO;
import com.campus.result.Result;
import com.campus.service.CaptchaService;
import com.campus.utils.CaptchaUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/captcha")
@CrossOrigin //允许跨域
@RequiredArgsConstructor
public class CaptchaController {

    private final CaptchaService captchaService;



    // 不完美
    @GetMapping
    public Result getCaptcha() throws IOException {
        CaptchaVO captcha = captchaService.getCaptcha();
        return Result.success(captcha);
    }

    @PostMapping
    public Result validCaptcha() {

        return Result.success();
    }
}
